1. Field of the Invention
The present invention relates, generally, to device access fairness, and in particular embodiments, to control of device access fairness in switched Fibre Channel (FC) fabric loop attachment systems.
2. Description of Related Art
As illustrated in the exemplary interconnection diagram of a storage system shown in FIG. 1, non-blocking frame-based crossbar switches (e.g. frame-based switches 100 and 102) enable the “fabric” interconnection of a large number of devices such as Host Bus Adapters (HBAs) 104 and 106, and groups of disk drives referred to as Just a Bunch Of Disks (JBODs) 108, 110, 112 and 114. The devices are connected to ports in the frame-based switches 100 and 102. For example, in FIG. 1, HBA 104 is connected to Port 1 on frame-based switch 100, JBOD 108 is connected to Port 2, JBOD 110 is connected to Port 3, and frame-based switch 102 is connected to Port 4.
Note that unlike FC arbitrated loop (AL) storage switches, which utilize an 8-bit Arbitrated Loop Protocol Address (ALPA), have a 126 device limit, connect and switch loop devices that must share the bandwidth, and cannot be connected to any other storage switch, frame-based switches utilize a 24-bit address (which includes 8-bit domain and area fields in addition to an 8-bit ALPA), have a much higher device limit, and connect and switch devices that do not have to share the bandwidth. Frame-based switches also support loop devices, such as disk drives in a JBOD connected via a port, and can also be connected to other frame-based switches via an inter-switch link.
The various devices connected to a frame-based switch communicate with other devices through the frame-based switch. For example, HBA 104 (through Port 1) may transmit one or more FC frames to Port 1 on frame-based switch 100, essentially containing a request that data be retrieved from, or sent to, each drive in JBOD 108 (through Port 2), each drive in JBOD 110 (through Port 3), each drive in JBOD 110 (through Port 3), and each drive in JBODs 112 and 114 (through Port 4). Port 1 converts these frames into a request for router 116, which includes the source and destination addresses for the data transfer.
If, for example, the router 116 receives a request for a connection from the HBA 104 to a drive in JBOD 108 and is able to make the appropriate connection, then after the drive receives the FC frame from the HBA 104, the drive may send back a response intended for HBA 104 that contains some of the requested data (e.g. a 2 kByte block of data), or a response indicating that the write operation to that drive is now complete. If connections are also made to drives in other ports, similar responses may be sent back by those drives connected to the other ports. It should be understood that the communications described above are only representative of the types of requests and responses that may be issued by the devices, and that other housekeeping requests and responses, such as a Loop Initialization Protocol (LIP) ordered set, may also be issued by the devices. In any case, because the connections needed to facilitate these requests and responses usually cannot be made at the same time (due to contention for the same ports), many of these requests and responses will not be processed immediately, but rather will remain pending or outstanding for a period of time. Routers 116 and 118 are used to receive and arbitrate these requests and responses from the devices, and then configure the frame-based switch 100 to make the connections necessary to give access to devices on ports according to a fairness scheme. Once a device is given access, it can send the request or response.
In conventional AL storage switches connected to a relatively small number of devices, and in particular when the same number of devices are connected to each port, arbitration may be performed using a simple round-robin fairness scheme wherein the ports in the AL storage switch are given access one at a time, and a single request or response from a device would be transmitted through a particular port when that port had been given access. However, if each port is connected to a different number of devices, such as in the frame-based switch example of FIG. 1, this simple round-robin scheme generally does not provide a fair arbitration scheme. For example, assume that Port 2 in frame-based switch 100 is connected to 10 drives (see values in parentheses in FIG. 1) in JBOD 108, Port 3 is connected to 20 drives in JBOD 110, and Port 4 is connected to 30 drives (10 drives in JBOD 112 and 20 drives in JBOD 114). If HBA 104 wants to access each drive, then giving each port one opportunity for access at a time will generally be unfair, because Port 4 will have three times as many drives sending responses back as Port 2, yet both Port 4 and Port 2 are given the same number of access opportunities. With a simple round-robin fairness scheme, drives connected to Port 4 would be “starved,” while devices connected to Port 2 would be frequently given access for their requests. If the cascade of frame-based switches in the example of FIG. 1 were continued downward, and a simple round-robin fairness scheme was used for each frame-based switch, devices connected to lower frame-based switches would be starved even more than the devices connected to frame-based switch 102. Not only will bandwidth be severely reduced for the starved devices, but some devices will assume that a malfunction has occurred, and will attempt to reset the entire system. Furthermore, conventional arbitration schemes to not account for different device types. For example, an initiator such as a host computer 120 connected to HBA 104 or a tape drive (not shown in FIG. 1) may have requests that are entitled to higher priority than responses being sent from a disk drive in JBOD 108, but conventional arbitration schemes do not recognize these device-based priority differences.
Therefore, there is a need to control device access fairness in frame-based switches to account for the number of active devices (devices actively transferring data) connected to each port, and the type of devices connected to each port.